Product Code Database
Example Keywords: bioshock -table $18
barcode-scavenger
   » » Wiki: Virtual Address Space
Tag Wiki 'Virtual Address Space'.
Tag

Virtual address space
 (

 C O N T E N T S 
Rank: 100%
Bluestar Bluestar Bluestar Bluestar Blackstar

In , a virtual address space ( VAS) or is the set of ranges of virtual addresses that an makes available to a process. The range of virtual addresses usually starts at a low address and can extend to the highest address allowed by the computer's and supported by the 's pointer size implementation, which can be 4 for 32-bit or 8 for 64-bit OS versions. This provides several benefits, one of which is security through process isolation assuming each process is given a separate .


Example
In the following description, the terminology used will be particular to the operating system, but the concepts are applicable to other operating systems.

When a new application on a 32-bit OS is executed, the process has a VAS: each one of the (from 0 to 232 − 1) in that space can have a single byte as a value. Initially, none of them have values ('-' represents no value). Using or setting values in such a VAS would cause a .

           0                                           4 GiB
VAS        |----------------------------------------------|
     

Then the application's executable file is mapped into the VAS. Addresses in the process VAS are mapped to bytes in the exe file. The OS manages the mapping:

           0                                           4 GiB
VAS        |---vvv----------------------------------------|
mapping        |||
file bytes     app
     

The v's are values from bytes in the mapped file. Then, required DLL files are mapped (this includes custom libraries as well as system ones such as kernel32.dll and user32.dll):

           0                                           4 GiB
VAS        |---vvv--------vvvvvv---vvvv-------------------|
mapping        |||        ||||||   ||||
file bytes     app        kernel   user
     

The process then starts executing bytes in the EXE file. However, the only way the process can use or set '-' values in its VAS is to ask the OS to map them to bytes from a file. A common way to use VAS memory in this way is to map it to the . The page file is a single file, but multiple distinct sets of contiguous bytes can be mapped into a VAS:

           0                                           4 GiB
VAS        |---vvv--------vvvvvv---vvvv----vv---v----vvv--|
mapping        |||        ||||||   ||||    ||   |    |||
file bytes     app        kernel   user   system_page_file
     

And different parts of the page file can map into the VAS of different processes:

           0                                           4 GiB
VAS 1      |---vvvv-------vvvvvv---vvvv----vv---v----vvv--|
mapping        ||||       ||||||   ||||    ||   |    |||
file bytes     app1 app2  kernel   user   system_page_file
mapping             ||||  ||||||   ||||       ||   |
VAS 2      |--------vvvv--vvvvvv---vvvv-------vv---v------|
     

On Microsoft Windows 32-bit, by default, only are made available to processes for their own use. The other are used by the operating system. On later 32-bit editions of Microsoft Windows, it is possible to extend the user-mode virtual address space to while only is left for kernel-mode virtual address space by marking the programs as IMAGE_FILE_LARGE_ADDRESS_AWARE and enabling the switch in the boot.ini file.

On Microsoft Windows 64-bit, in a process running an executable that was linked with , the operating system artificially limits the user mode portion of the process's virtual address space to 2 GiB. This applies to both 32- and 64-bit executables. Processes running executables that were linked with the option, which is the default for 64-bit Visual Studio 2010 and later, have access to more than of virtual address space: up to for 32-bit executables, up to for 64-bit executables in Windows through Windows 8, and up to for 64-bit executables in Windows 8.1 and later.

Allocating memory via C's establishes the page file as the backing store for any new virtual address space. However, a process can also explicitly map file bytes.


Linux
For x86 CPUs, 32-bit allows splitting the user and kernel address ranges in different ways: 3G/1G user/kernel (default), 1G/3G user/kernel or 2G/2G user/kernel.


See also
  • Linear address space
  • Single address space operating system


Notes
  • " Advanced Windows" by Jeffrey Richter, Microsoft Press

Page 1 of 1
1
Page 1 of 1
1

Account

Social:
Pages:  ..   .. 
Items:  .. 

Navigation

General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 

Statistics

Page:  .. 
Summary:  .. 
1 Tags
10/10 Page Rank
5 Page Refs